/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BusinessLogic;
import DataAccess.*;
import java.util.Vector;
import javax.swing.table.TableModel;
/**
 *
 * @author thangvv0907i
 */

public class InventoryManagementFunction_BL {

    InventoryManagerFunction_DA function_DA=new InventoryManagerFunction_DA();
    public int getTotalCate_BL() {
        int totalCate = new InventoryManagerFunction_DA().getTotalCate_DA();
        return totalCate;
    }

    public int getTotalItems_BL() {
        int totalItems = new InventoryManagerFunction_DA().getTotalItems_DA();
        return totalItems;
    }
    public TableModel ItemTable()
    {
        TableModel TB=new InventoryManagerFunction_DA().getItemTableValue();
        return TB;
    }

    public String updateQuantity(int Quantity,String ItemID) {
        int respond = new InventoryManagerFunction_DA().updateQuantity_DA(Quantity,ItemID);
        String message = null;
        if(respond!=0)
        {
            message = "Update Quantity Successful!";
        }else{
            message = "Choice a Item";
        }
        return message;
    }

    public int ViewItemNotAvailable() {
        int ItemNot=function_DA.ViewItemNotAvailable();
        return ItemNot;
    }

    public TableModel GetItemNotAvailable() {
        TableModel tb=function_DA.getItemNot();
        return tb;
    }

    public float getTotalPrice() {
        float TotalPrice=function_DA.getTotalPrice();
        return TotalPrice;
    }

    public int getTotalItemSold() {
        int TotalItemSold=function_DA.getTotalItemSold();
        return TotalItemSold;
    }
    public TableModel getItemsSold()
    {
        TableModel tb=function_DA.getItemsSold();
        return tb;
    }

    public Vector GetCategory(int Index) {
        Vector cate= function_DA.getCate(Index);
        return cate;
    }

    public TableModel getItembyCate(String CName,int month) {
        TableModel tb=function_DA.getItemCate(CName,month);
        return tb;
    }

}
